const path = require('path')
module.exports = {
    outputDir: 'build',
    lintOnSave: false,
    chainWebpack: config => {
        // 定义根目录
        config.resolve.alias
            .set('@', path.join(__dirname, './src'))
    },
    devServer: {
        port: 8080,
        open: true,
        overlay: {
            warnings: true,
            errors: true
        },
        proxy: {
            '/mmdb': {
                target: 'https://wx.maoyan.com',
                changeOrigin: true
            },
            // '/api': {
            //     target: 'http://localhost:8080',
            //     changeOrigin: true,
            //     // pathRewrite: {
            //     //   '^/api': ''
            //     // }
            // },
            '/ajax': {
                target: 'https://m.maoyan.com',
                changeOrigin: true
            }
        }
    }
}